import request from '@/utils/request'

// 用户登录
// Login = '/sys/login',
export function login(data) {
  return request({
    url: '/sys/login',
    method: 'post',
    data
  })
}

// 获取验证码
// http://36.139.240.17:8081/gaoyou/sys/randomImage/1629428467008?_t=1753888233906
export function getYzm() {
  return request({
    url: `/sys/randomImage/1629428467008?_t=${new Date().getTime()}`,
    method: 'get',
    // responseType: 'arraybuffer' // 使用arraybuffer而不是blob
  })
}

// 获取比对列表
export function getTaskList() {
  return request({
    url: '/api/pdf/compare/taskList',
    method: 'get',
  })
}

// 获取比对详情
export function queryTaskInfo(data) {
  return request({
    url: `/api/pdf/compare/queryTaskInfo?id=${data.id}`,
    method: 'get',
  })
}

// 生成比对报告
export function generateReport(data) {
  return request({
    url: `/api/pdf/compare/generateReport?id=${data.id}`,
    method: 'get',
  })
}

// http://36.139.240.17:8081/pdf-compare/api/pdf/compare/files
export function compareFiles(data) {
  return request({
    url: '/api/pdf/compare/files',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

export function compareFiles2(data) {
  return request({
    url: '/api/pdf/compare/files2',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}



// 获取用户信息
export function getUserInfo() {
  return request({
    url: '/user/info',
    method: 'get'
  })
}

// 用户登出
export function logout() {
  return request({
    url: '/user/logout',
    method: 'post'
  })
}